import { NgModule } from '@angular/core';
import { BrowserModule, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { DatePipe } from '@angular/common';
import { HTTP } from '@ionic-native/http/ngx';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { Camera } from '@ionic-native/camera/ngx';
import { FileTransfer } from '@ionic-native/file-transfer/ngx';
import { FileOpener } from '@ionic-native/file-opener/ngx';
import { File } from '@ionic-native/file/ngx';
import { Insomnia } from '@ionic-native/insomnia/ngx';
import { Network } from '@ionic-native/network/ngx';
import { BackgroundMode } from '@ionic-native/background-mode/ngx';
import { Keyboard } from '@ionic-native/keyboard/ngx';
import { CodePush } from '@ionic-native/code-push/ngx';
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { LocalNotifications } from '@ionic-native/local-notifications/ngx';

import { CoreModule } from './core/core.module';
import { SharedModule } from './shared/shared.module';

import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { IonicStorageModule } from '@ionic/Storage';
import { JPush } from '@jiguang-ionic/jpush/ngx';
import { NgxEchartsModule } from 'ngx-echarts';

import { ADModalModule } from '@modals/ad-modal/ad-modal.module';
import { MultipleSelectModalModule } from '@modals/multiple-select/multiple-select.module';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { MyHammerConfig } from '@services/MyHammerConfig';
import { EFOSHttpInterceptor } from '@services/http.interceptor.service';
import { Media } from '@ionic-native/media/ngx';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { VgStreamingModule } from 'videogular2/streaming';
import { AppUpdate } from '@ionic-native/app-update/ngx';
import { UpdateModalModule } from '@modals/update-modal/update-modal.module';
import { AppVersion } from '@ionic-native/app-version/ngx';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    CoreModule,
    SharedModule,
    BrowserModule,
    IonicModule.forRoot({
      backButtonText: '',
    }),
    AppRoutingModule,
    StoreModule.forRoot({}),
    EffectsModule.forRoot([]),
    IonicStorageModule.forRoot(),
    NgxEchartsModule,
    ADModalModule,
    MultipleSelectModalModule,
    VgStreamingModule,
    UpdateModalModule,
  ],
  providers: [
    StatusBar,
    SplashScreen,
    BackgroundMode,
    File,
    FileTransfer,
    FileOpener,
    Insomnia,
    Network,
    Keyboard,
    DatePipe,
    HTTP,
    JPush,
    Camera,
    LocalNotifications,
    CodePush,
    Media,
    ScreenOrientation,
    AndroidPermissions,
    AppUpdate,
    AppVersion,
    InAppBrowser,
    { provide: HAMMER_GESTURE_CONFIG,  useClass: MyHammerConfig },
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    { provide: HTTP_INTERCEPTORS, useClass: EFOSHttpInterceptor, multi: true },
  ],
  bootstrap: [AppComponent]
})

export class AppModule { }
